<link rel="stylesheet" href="../plugin/haya_admin_nav/css/haya_nav.css<?php echo $static_version;?>">

<nav class="navbar navbar-default navbar-dark bg-inverse navbar-full navbar-fixed-top" id="header">

	<!-- PC 导航 -->
	<div class="container collapse navbar-toggleable-md">
		<div class="row">
		
			<!-- 左侧：菜单区域 -->
			<div class="col-md-8">
				<ul class="nav navbar-nav" id="nav_pc">
				
					<!--{hook admin_header_nav_pc_start.htm}-->
					
					<li class="nav-item">
						<img src="../view/img/logo.png" class="logo-sm">
					</li>
					<li class="nav-item home">
						<a class="nav-link" href="./"><i class="icon-home" aria-hidden="true"></i> <?php echo lang('admin_index_page');?></a>
					</li>
					<?php foreach ($menu as $k=>$v) { ?>
						<?php if (isset($v['tab']) && !empty($v['tab'])) { ?>
							<li class="nav-item <?php echo $k;?> dropdown ">
								<a href="javascript:;" class="nav-link dropdown-toggle haya-dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
									<i class="<?php echo $v['icon'];?>"></i>
									<?php echo $v['text'];?> 
									<span class="icon-caret-down"></span>
								</a>
								<ul class="haya-dropdown-menu dropdown-menu" role="menu">
									<?php foreach ($v['tab'] as $tab_k => $tab_v) { ?>
										<li class="dropdown <?php echo $tab_k; ?>">
											<a href="<?php echo $tab_v['url']; ?>">
												<?php if (isset($tab_v['icon'])) { ?>
													<i class="$tab_v['icon']"></i>
												<?php } else { ?>
													<i class="icon-eraser"></i>
												<?php } ?>
												<?php echo $tab_v['text']; ?>
											</a>
										</li>
									<?php  } ?>
								</ul>
							</li>	
						<?php  } else { ?>
							<li class="nav-item <?php echo $k;?>">
								<a class="nav-link" href="<?php echo $v['url'];?>"><i class="<?php echo $v['icon'];?>"></i> <?php echo $v['text'];?></a>
							</li>
						<?php  } ?>
					<?php  } ?>
					
					<!--{hook admin_header_nav_pc_end.htm}-->
					
				</ul>
			</div>
			
			<!-- 右侧：用户区域 / right: user -->
			<div class="col-md-4">
				<ul class="nav navbar-nav pull-right small">
					
					<!--{hook admin_header_nav_pc_user_start.htm}-->
				
					<li class="nav-item">
						<a class="nav-link" href="../<?php echo url('my');?>"><img class="avatar-xs" src="../<?php echo isset($user['avatar_url']) ? $user['avatar_url'] : '';?>"></a>
					</li>
					<li class="nav-item username  m-l-xs">
						<a class="nav-link" href="../<?php echo url('my');?>"><?php echo isset($user['username']) ? $user['username'] : '';?></a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="../"><i class="icon-home" aria-hidden="true"></i> <?php echo lang('front_index_page');?></a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="<?php echo url('index-logout');?>"><?php echo lang('logout');?></a>
					</li>
					
					<!--{hook admin_header_nav_pc_user_end.htm}-->
				</ul>
			</div>
		</div>
	</div>
	
	
	<!-- 手机导航 -->
	<div class="container hidden-lg-up navbar-nav">
		<div class="row">
			<!-- 左侧：折叠图标 -->
			<div class="col-xs-4">
				 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mobile_collapsing_bavbar">
					☰
				 </button>
			</div>
			
			<!-- 中间：标题 -->
			<div class="col-xs-4 text-center">
				<?php if($route == 'index') { ?>
				<a class="nav-link p-y-0" href="."><img src="../view/img/logo.png" class="logo-sm center-block"></a>
				<?php } else { ?>
				<span class="nav-link"><?php echo $header['mobile_title'];?></span>
				<?php } ?>
			</div>
			<!-- 右侧：登陆 -->
			<div class="col-xs-4">
				<div class="pull-right">
					<div class="nav-item small">
						<a class="nav-link" href="<?php echo url('index-logout');?>"><?php echo lang('logout');?></a>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<!-- 手机导航：下拉菜单 -->
	<div class="collapse" id="mobile_collapsing_bavbar">
		<div class="bg-inverse p-a-1">
			<ul class="nav" id="nav_mobile">
				<hr class="m-y-0" />
				<li class="nav-item home">
					<a class="nav-link" href="./"><i class="icon-home" aria-hidden="true"></i> <?php echo lang('admin_page');?></a>
				</li>
				<hr class="m-y-0" />
				
				<!--{hook admin_header_nav_mobile_forum_before.htm}-->
				
				<?php foreach ($menu as $k=>$v) { ?>
					<?php if (isset($v['tab']) && !empty($v['tab'])) { ?>
						<li class="nav-item <?php echo $k;?> dropdown ">
							<a href="javascript:;" class="nav-link dropdown-toggle haya-dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
								<i class="<?php echo $v['icon'];?>"></i>
								<?php echo $v['text'];?> 
								<span class="icon-caret-down"></span>
							</a>
							<ul class="nav dropdown-menu haya-dropdown-menu" role="menu">
								<?php foreach ($v['tab'] as $tab_k => $tab_v) { ?>
									<li class="nav-item dropdown <?php echo $tab_k; ?>">
										<a href="<?php echo $tab_v['url']; ?>">
											<?php if (isset($tab_v['icon'])) { ?>
												<i class="$tab_v['icon']"></i>
											<?php } else { ?>
												<i class="icon-eraser"></i>
											<?php } ?>
											<?php echo $tab_v['text']; ?>
										</a>
									</li>
									<hr class="m-y-0" />
								<?php  } ?>
							</ul>
						</li>	
						<hr class="m-y-0" />
					<?php  } else { ?>
						<li class="nav-item <?php echo $k;?>">
							<a class="nav-link" href="<?php echo $v['url'];?>"><i class="<?php echo $v['icon'];?>"></i> <?php echo $v['text'];?></a>
						</li>
						<hr class="m-y-0" />
					<?php  } ?>
				<?php  } ?>
				<li class="nav-item home">
					<a class="nav-link" href="../"><i class="icon-home" aria-hidden="true"></i> <?php echo lang('return');?><?php echo lang('front_index_page');?></a>
				</li>
				
				<!--{hook admin_header_nav_mobile_return_after.htm}-->
				
			</ul>
		</div>
	</div>
	
</nav>
